package org.jasper.impl.session;

import org.jasper.api.base.KieBaseModel;
import org.jasper.api.session.KieSessionModel;
import org.jasper.constants.BeliefSystemType;
import org.jasper.impl.base.KieBaseModelImpl;
import org.jasper.impl.option.BeliefSystemTypeOption;
import org.jasper.impl.option.ClockTypeOption;

/**
 * Created by OP038074 on 2018/7/19.
 */
public class KieSessionModelImpl implements KieSessionModel {

    private String name;
    private KieBaseModelImpl kBase;
    private boolean isDefault = false;
    private KieSessionType type = KieSessionType.STATEFUL;
    private ClockTypeOption clockType = ClockTypeOption.get( "realtime" );
    private BeliefSystemTypeOption beliefSystem = BeliefSystemTypeOption.get(BeliefSystemType.SIMPLE.toString());


    private KieSessionModelImpl() { }

    public KieSessionModelImpl(KieBaseModelImpl kBase, String name) {
        this.kBase = kBase;
        this.name = name;
    }

    public String getName() {
        return name;
    }

    public KieSessionModel setDefault(boolean isDefault) {
        this.isDefault = isDefault;
        return this;
    }

    public KieSessionModel setType(KieSessionType type) {
        this.type = type;
        return this;
    }

    public KieSessionType getType() {
        return type;
    }

    public KieBaseModelImpl getKieBaseModel() {
        return kBase;
    }
    public void setKBase(KieBaseModel kieBaseModel) {
        this.kBase = (KieBaseModelImpl) kieBaseModel;
    }

    public ClockTypeOption getClockType() {
        return clockType;
    }

    public BeliefSystemTypeOption getBeliefSystem() {
        return beliefSystem;
    }
}
